package com.example.controller;

import com.example.client.UserClient;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer/user")
public class UserController {
    @Autowired
    private UserClient userClient;

    @GetMapping
    public User queryUserById(@RequestParam("id") Long id) {
        User user = userClient.queryById(id);
        return user;
    }
}
